/**   
* @Title: OutstorageBillService2Impl.java 
* @Package cn.kxm.service.impl 
* @Description: TODO(用一句话描述该文件做什么) 
* @author 初雨泽
* @date 2018年10月16日 下午3:59:29   
*/
package cn.kxm.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.kxm.dao.OutstorageBillDao;
import cn.kxm.dao.CollectBillDetailDao;
import cn.kxm.pojo.OutstorageBill;
import cn.kxm.pojo.OutstorageBillDetail;
import cn.kxm.service.OutstorageBillService2;

/** 
* @ClassName: OutstorageBillService2Impl 
* @Description: TODO(这里用一句话描述这个类的作用) 
* @author 初雨泽
* @date 2018年10月16日 下午3:59:29 
*  
*/
@Service
public class OutstorageBillService2Impl implements OutstorageBillService2{
	@Autowired
	OutstorageBillDao outstorageBillDao;

	@Autowired
	CollectBillDetailDao collectBillDetailDao;

	/* (non-Javadoc)
	 * @see cn.kxm.service.OutstorageBillService#findCollectBillDetail(java.lang.String)
	 */
	@Override
	public OutstorageBill findCollectBillDetail(String collectCode) {
		return outstorageBillDao.findOutstorageBillByBillCode(collectCode);
	}

	/* (non-Javadoc)
	 * @see cn.kxm.service.OutstorageBillService#updateOutstorageBillType(java.lang.String, java.lang.Integer)
	 */
	@Override
	public void updateOutstorageBillType(String code, Integer type) {
		outstorageBillDao.updateOutstorageBillType(code, type);
	}

	/* (non-Javadoc)
	 * @see cn.kxm.service.OutstorageBillService#findUnselectedOutstorageBill(java.lang.Integer, java.lang.Integer)
	 */
	@Override
	public List<OutstorageBill> findUnselectedOutstorageBill(Integer page, Integer rows,
			String findcode,
			String findstartDate,
			String findendDate,
			String findsupplierName,
			String collectCode) {
		System.out.println("findsupplierName:"+findsupplierName);
		System.out.println("outstorageBill:"+outstorageBillDao.findUnselectedOutstorageBill(((page-1)*rows), rows,findcode,findstartDate,findendDate,findsupplierName,collectCode));
		return outstorageBillDao.findUnselectedOutstorageBill(((page-1)*rows), rows,findcode,findstartDate,findendDate,findsupplierName,collectCode);
	}

	/* (non-Javadoc)
	 * @see cn.kxm.service.OutstorageBillService#countUnselectedOutstorageBill()
	 */
	@Override
	public int countUnselectedOutstorageBill(String findcode,
			String findstartDate,
			String findendDate,
			String findsupplierName,
			String collectCode) {
		return outstorageBillDao.countUnselectedOutstorageBill(findcode,findstartDate,findendDate,findsupplierName,collectCode);
	}

	/* (non-Javadoc)
	 * @see cn.kxm.service.OutstorageBillService#findOutstorageBillByCollectBillCode(java.lang.String, java.lang.Integer, java.lang.Integer)
	 */
	@Override
	public List<OutstorageBill> findOutstorageBillByCollectBillCode(String collectCode) {
		List<String> list=collectBillDetailDao.findBillCodeByCollectCode(collectCode);
		return outstorageBillDao.findOutstorageBillByCollectBillCode(list);


	}

	/* (non-Javadoc)
	 * @see cn.kxm.service.OutstorageBillService2#findOrderCodeFromOutstorDetail(java.lang.String)
	 */
	@Override
	public List<String> findOrderCodeFromOutstorDetail(String billCode) {
		return outstorageBillDao.findOrderCodeFromOutstorDetail(billCode);
	}

	/* (non-Javadoc)
	 * @see cn.kxm.service.OutstorageBillService2#updateSellorderPayStatus(java.util.List)
	 */
	@Override
	public void updateSellorderPayStatus(List<String> list,int type) {
		outstorageBillDao.updateSellorderPayStatus(list,type);
	}

}
